<?php
  require_once('class.phpmailer.php');
  class ConfigMail {
  private $mail;
  
  public function __construct($exceptions = false) {
  
  $this->mail = new PHPMailer($exceptions);
  $this->mail->IsSMTP();
  $this->mail->SMTPDebug  = SMTPDebug;                     // enables SMTP debug information (for testing)
  $this->mail->SMTPAuth   = SMTPAuth;                  // enable SMTP authentication
  $this->mail->SMTPSecure = SMTPSecure;                 // sets the prefix to the servier
  $this->mail->Host       = Host;      // sets GMAIL as the SMTP server
  $this->mail->Port       = Port;                   // set the SMTP port for the GMAIL server
  $this->mail->Username   = Username;  // GMAIL username
  $this->mail->Password   = Password;            // GMAIL password
  $this->mail->SetFrom(From,NameFrom);
  $this->mail->CharSet=CharSet;
  //$mail->AddAddress('Recipient@example.com', 'Recipient Name');

      //$mail->AddReplyTo('name@yourdomain.com', 'First Last');
 // $this->mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
//  $this->mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
  
    //  $this->mail->AddAttachment('images/phpmailer.gif');      // attachment
   //   $this->mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
   //   $mail->Send();
      //echo "Message Sent OK</p>\n";
  
  }
  public function setTo($email,$name)
  {
  
  $this->mail->AddAddress($email,$name);
  }
  public function setFrom($email,$name)
  {
  
  $this->mail->SetFrom($email,$name);
  
  }
  public function sendTo()
  {
  $this->mail->Send();
  }
  public function setSubject($subject)
  {
  $this->mail->Subject = $subject;
  }
  public function setBody($body)
  {
  $this->mail->AltBody=$body;
  }
  public function setContent($contents)
  {
  $this->mail->MsgHTML($contents);
  
  }
  
  }
?>
